package com.suse.lhw.hms.authorizaiontserver.service.Impl;


import com.suse.lhw.hms.authorizaiontserver.dao.UPermissionMapper;
import com.suse.lhw.hms.authorizaiontserver.domin.UPermission;
import com.suse.lhw.hms.authorizaiontserver.service.UPermissionService;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * @ProjectName: health_manage_system
 * @Package: com.suse.lhw.security.service.Impl
 * @ClassName: UPermissionServiceImpl
 * @Description: java类作用描述
 * @Author: 李鸿炜
 * @CreateDate: 2021/1/31 19:24
 * @UpdateUser: 更新者
 * @UpdateDate: 2021/1/31 19:24
 * @UpdateRemark: 更新说明
 * @Version: 1.0
 */
@Service
public class UPermissionServiceImpl implements UPermissionService {

    @Resource
    private UPermissionMapper uPermissionMapper;

    @Override
    public int deleteByPrimaryKey(Integer id) {
        return uPermissionMapper.deleteByPrimaryKey(id);
    }

    @Override
    public int insert(UPermission record) {
        return uPermissionMapper.insert(record);
    }

    @Override
    public int insertSelective(UPermission record) {
        return uPermissionMapper.insertSelective(record);
    }

    @Override
    public UPermission selectByPrimaryKey(Integer id) {
        return uPermissionMapper.selectByPrimaryKey(id);
    }

    @Override
    public int updateByPrimaryKeySelective(UPermission record) {
        return uPermissionMapper.updateByPrimaryKeySelective(record);
    }

    @Override
    public int updateByPrimaryKey(UPermission record) {
        return uPermissionMapper.updateByPrimaryKey(record);
    }

    @Override
    public List<GrantedAuthority> selectListByUserId() {
        //通过传来的用户id找权限，从u_role_user找u_role，再通过这个 AuthorityUtils.commaSeparatedStringToAuthorityList()转成凭证
//        List<URoleUser> UToRLists=
        return null;
    }

}
